package JDBCUI;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Staff extends  JFrame {






    public Staff() {



            // 可以发现按钮和文本框都已经有了变化，给窗口润色不少。
            try {
                for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                    if ("Nimbus".equals(info.getName())) {
                        javax.swing.UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            }catch(Exception e) {
                System.out.println(e);
            }



            //创建顶层容器



            //创建按钮组件
        JButton buttonreturn = new JButton("返回");
            JButton button1 = new JButton("添加");
            JButton button2 = new JButton("修改");
            JButton button3 = new JButton("查询");
            JButton button4 = new JButton("删除");
            JButton button5 = new JButton("浏览奖惩编号总情况");
            //流布局 左对齐，间距
           // FlowLayout flow = new FlowLayout(FlowLayout.LEFT,50,50);
            //创建中间容器
          //  JPanel panel = new JPanel(flow);
            //将负责放置控件的面板设置成透明
            // panel.setOpaque(false);

        JPanel jpforbutton = new JPanel(new GridLayout(1,1));
            //设置大小
            jpforbutton.setSize(500,400);
            //设置背景颜色
            jpforbutton.setBackground(Color.LIGHT_GRAY);

        jpforbutton.add(button1);
        jpforbutton.add(button2);
        jpforbutton.add(button3);
        jpforbutton.add(button4);
        jpforbutton.add(button5);
        jpforbutton.add(buttonreturn);

            //将中间容器放在窗口中





        button1.addActionListener(new ActionListener(){

            public void actionPerformed(ActionEvent e){
                increase increase =new increase();
            }
        });
        button2.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                revise revise =new revise();
            }
        });
        button3.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                query query =new query();
            }
        });
        button4.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                Delete delete =new Delete();
            }
        });
        button5.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                browse browse =new browse();
            }
        });


        buttonreturn.addActionListener(new ActionListener(){

            public void actionPerformed(ActionEvent e){
                dispose();
            }

        });


        this.setTitle("管理奖惩信息");
        this.setLayout(new GridLayout(9,1));
            //显示窗口
        this.add(jpforbutton);
        this.setLocation(800,300);
        this.setSize(1000,400);
        this.setVisible(true);
    }


    }





